package com.tan.chowder.mock.controller;

import com.tan.chowder.mock.bean.Result;
import com.tan.chowder.mock.service.SqlBuilderService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author chenx
 * @version 1.0
 * @description: TODO
 * @date 2024/5/9 0:14
 */
@RestController("/sqlBuilder")
public class SqlBuilderController {
    @Resource
    private SqlBuilderService sqlBuilderService;

    @PostMapping("/buildInsertSql")
    public Result buildInsertSql(@RequestBody String createSql){
        Result result = new Result();
        String insertSql = sqlBuilderService.buildInsertSql(createSql);
        return result.ok(insertSql);
    }
}
